package com.kerraway.dao;

import com.kerraway.model.OrderLog;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * @author 小柯
 * @date 2018/9/5
 */
public interface OrderLogRepository extends JpaRepository<OrderLog, Long> {

  List<OrderLog> findByCreatedAt(Date createdAt);

  List<OrderLog> findByCreatedAtIn(Collection<Date> createdAts);

  List<OrderLog> findByCreatedAtAfter(Date createdAt);

  List<OrderLog> findByCreatedAtBetween(Date createdAtStart, Date createdAtEnd);

  List<OrderLog> findByOrderIdAndCreatedAtBetween(Integer orderId, Date createdAtStart, Date createdAtEnd);

  List<OrderLog> findByCommentAndCreatedAtBetween(String comment, Date createdAtStart, Date createdAtEnd);

}